package cate.game.train.spice.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import easy.java.dev.note.NoteField;

import java.util.List;

@ClientMsg(title = "星格融合的请求")
@OperationSetter(GDOperation.SPICE_FUSE)
public class SpiceFuseReq implements MsgInput {
    @NoteField("融合星格uid")
    public List<String> costUids;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = game.train.spice.fuseSpice(cc.getRole(), costUids);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.SPICE_FUSE_REQ;
    }
}
